#ifndef __DOWNSAMPLER_H__
#define __DOWNSAMPLER_H__

class DownSampler
{
	void init();
	void free();

	int startwidth;
	int startheight;
	int endwidth;
	int endheight;

	float step;

	int compiled;

	int cntlayers;

	Texture **textures;
	Effect **fbos;

	int starttexbinded,endtexbinded;

	float *sizes;

public:
	DownSampler();
	DownSampler(int startwidth,int startheight,int endwidth,int endheight);
	DownSampler(int startsize,int endsize);
	~DownSampler();

	void StartSize(int width, int height);
	void EndSize(int width, int height);

	void StartSize(int size);
	void EndSize(int size);

	void Step(float step);
	int Compile();

	void BindStartTexture(Texture *start);
	void BindEndTexture(Texture *end);

	int GetStartWidth();
	int GetStartHeight();

	int GetEndWidth();
	int GetEndHeight();

	int Process();
};

#endif
